package com.zhxu.library.utils;

import android.content.Context;
import android.content.SharedPreferences;

import com.zhxu.library.api.XCDApplication;

/**
 * Created by zhangshaofang on 2015/8/6.
 */
public class PrfUtils {
    private static SharedPreferences mSharePreferences;

    public static SharedPreferences getSharePreferences() {

        mSharePreferences = XCDApplication.getInstance().getSharedPreferences(XCDApplication.getInstance().getPackageName() + "_preferences", Context.MODE_PRIVATE | Context.MODE_MULTI_PROCESS);

        return mSharePreferences;
    }

    public static boolean isDebug() {
        SharedPreferences preferences = PrfUtils.getSharePreferences();
        return preferences.getBoolean("isDebug",false);
    }

    public static void setDebug(boolean isDebug) {
        SharedPreferences preferences = getSharePreferences();
        SharedPreferences.Editor editor = preferences.edit();
        editor.putBoolean("isDebug", isDebug);
        editor.apply();

    }
}
